<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="true" name="HandheldFriendly">
    <title></title>
    <meta content="" name="keywords"/>
    <meta content="" name="description"/>
    <link href="/web/css/normalize.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/animate.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="/web/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
<div id="app" v-cloak>
    <div class="contain">
        <div class="sidebar" id="head">

        </div>
        <section>
            <div class="right_h" id="right_h">

            </div>
            <div class="qulicklink">
                <ul>
                    <li><a href="javascript:;"></a></li>
                    <li><a href="javascript:;"><span>企业首页</span><img src="/web/images/close.png"></a></li>
                    <li class="dq"><a href="javascript:;"><span>业务管理</span><img src="/web/images/close.png"></a></li>
                    <li><a href="javascript:;"></a></li>
                </ul>
            </div>
            <div class="breadcrumbs">
                <ul>
                    <li>业务管理</li>
                    <li>客户跟进</li>
                </ul>
            </div>
            <div class="clearfix"></div>
            <div class="content">
                <div class="addbtn" v-if="sum(30)">
                    <a @click="addbtnClick()" href="javascript:;">新增</a>
                </div>
                <div class="deletebtn" v-if="sum(32)">
                    <a @click="deletesClick()" href="javascript:;">删除</a>
                </div>
                <div class="importbtn" v-if="sum(33)">
                    <a @click="importClick()" href="javascript:;">导入</a>
                </div>
                                <div class="adSearchbtn" v-if="sum(1302)">
                                    <a @click="adSearchbtnClick()" href="javascript:;">高级搜索</a>
                                </div>
<!--                高级搜索下拉框开始-->
                                <div class="searchBox">
                                    <div class="searchKey">
                                        <label>
                                            <span>客户名称:</span> <input name="resetTc" placeholder="客户名称" type="text" @click="customerListchange()" value="" class="cum_name" />
                                        </label>
                                        <label>
                                            <span>跟进员工:</span>
                                            <div class="layui-input-block">
                                                <select id="departPosition" lay-filter="batch" lay-search="required"
                                                        lay-verify="required" name="resetval">
                                                    <option class="promptColor" value="">请选择跟进员工</option>
                                                    <option>xxxx</option>
                                                    <option>xxxx</option>
                                                    <option>xxxx</option>
                                                </select>
                                            </div>
                                        </label>
                                        <label>
                                            <span>跟进时间:</span>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" id="date1" placeholder="yyyy-MM-dd" type="text"  name="resetval" />
                                            </div>
                                        </label>
                                        <label>
                                            <span>跟进方式:</span>
                                            <div class="layui-input-block">
                                                <select id="departPosition" lay-filter="batch" lay-search="required"
                                                        lay-verify="required" name="resetval">
                                                <option class="promptColor" value="">请选择跟进方式</option>
                                                <option>电话</option>
                                                <option>面谈</option>
                                                </select>
                                            </div>
                                        </label>
                                        <label>
                                            <span>跟进内容</span> <input placeholder="请输入跟进内容关键字" type="text" name="resetval" />
                                        </label>
                                    </div>
                                    <div class="btns">
                                        <div class="addbtn searchbtn">
                                            <a @click="searchbtnClick()" href="javascript:;">搜索</a>
                                        </div>
                                        <div class="addbtn setbtn">
                                            <a @click="resetbtnClick()" href="javascript:;">重置</a>
                                        </div>
                                    </div>
                                </div>
<!--                高级搜索下拉框结束-->

                <div class="search">
                    <!--模糊查询开始-->
                    <label>
                        <span>搜索:</span>
                        <div class="searchbox">
                            <input @input="search($event,'track','title')" placeholder="请输入您要搜索的客户名称" type="text">
                        </div>
                    </label>
                    <!--模糊查询结束-->
                </div>

                <!-- 这里是新增编辑弹出框开始-->
                <div class="cusTracking hidden">
                    <div class="addtitle">基本信息</div>
                    <div class="layerbody">
                        <label>
                            <span>客户名称:</span> <input :value="(archivestitle)" @click="customerListchange()"
                                                      autocomplete="off" class="cum_name"
                                                      name="resetTc" placeholder="客户名称"
                                                      readonly type="text"/>
                        </label>
                        <label>
                            <span>联系人:</span> <input :value="(contacts)" @input="changecontacts($event)"
                                                     autocomplete="off"
                                                     class="contacts" id="contacts" name="resetTc" placeholder="请输入联系人"
                                                     type="text"/>
                        </label>
                        <label>
                            <span>跟进时间:</span>
                            <div class="layui-input-inline">
                                <input :value="(lasttime)" autocomplete="off" class="layui-input" id="tracktime"
                                       name="resetTc" placeholder="yyyy-MM-dd" type="text">
                            </div>
                        </label>
                        <label>
                            <span>跟进方式:</span>
                            <div class="layui-input-block">
                                <select autocomplete="off" class="industry" id="trackfunid"
                                        lay-filter="batch" lay-search="required" lay-verify="required" name="resetTc"
                                        v-model="trackfunid">
                                    <option class="promptColor" value="0">请选择跟进方式</option>
                                    <option :value="v.id" v-for="(v,k) in ajaxData.trackfun">{{v.title}}</option>
                                </select>
                            </div>
                        </label>
                        <label>
                            <span>跟进阶段:</span>
                            <div class="layui-input-block">
                                <select autocomplete="off" class="industry" id="trackstageid"
                                        lay-filter="batch" lay-search="required" lay-verify="required" name="resetTc"
                                        v-model="trackstageid">
                                    <option class="promptColor" value="0">请选择跟进阶段</option>
                                    <option :value="v.id" v-for="(v,k) in ajaxData.trackstage">{{v.title}}</option>
                                </select>
                            </div>
                        </label>
                        <label>
                            <span>客户状态:</span>
                            <div class="layui-input-block">
                                <select class="industry" id="status" lay-filter="batch"
                                        lay-search="required" lay-verify="required" name="resetTc" v-model="status">
                                    <option class="promptColor" value="0">请选择状态</option>
                                    <option value="1">有效客户</option>
                                    <option value="0">无效客户</option>
                                </select>
                            </div>
                        </label>
                        <label>
                            <span>提醒日期:</span>
                            <div class="layui-input-inline">
                                <input :value="()" autocomplete="off" class="layui-input" id="remindtime"
                                       name="resetTc" placeholder="yyyy-MM-dd" type="text">
                            </div>
                        </label>
                        <div class="address">
                            <label>
                                <span>跟进内容:</span>
                                <textarea class="contents" id="contents" name="resetTc" placeholder="请输入您的跟进内容"
                                          resize=""
                                          rows="4">{{contents}}</textarea>
                            </label>
                        </div>

                    </div>
                    <button @click="addsureBtn()" class="surebtn" type="submit">确认</button>
                    <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                </div>
                <!--这里是新增编辑弹出框结束-->
                <!--回访页面弹窗开始-->
                <div class="visitBox hidden">
                    <div class="layerbody">
                        <div class="addbtn">
                            <a @click="addvisitClick()" href="javascript:;">新增</a>
                        </div>
                        <div class="visitList">
                            <ul>
                                <li>
                                    <ol><input @click="deleteCheckAll()" class="checkboxAll" id="deleteCheckAll"
                                               type="checkbox"> 全选
                                    </ol>
                                    <ol>序号</ol>
                                    <ol>客户状态</ol>
                                    <ol>提醒日期</ol>
                                    <ol>操作</ol>
                                </li>
                                <li>
                                    <ol><input class="selectCheck" type="checkbox"></ol>
                                    <ol>1</ol>
                                    <ol>无效客户</ol>
                                    <ol>2021-5-21</ol>
                                    <ol>
                                        <div class="editor">
                                            <a @click="editorClick()" href="javascript:;">
                                                <img src="images/editor.png">
                                            </a>
                                            <span>编辑</span>
                                        </div>
                                        <div class="deletes">
                                            <a @click="deletesClick()" href="javascript:;">
                                                <img src="images/deletes.png">
                                            </a>
                                            <span>删除</span>
                                        </div>
                                    </ol>
                                </li>
                                <li>
                                    <ol><input class="selectCheck" type="checkbox"></ol>
                                    <ol>2</ol>
                                    <ol>无效客户</ol>
                                    <ol>2021-5-21</ol>
                                    <ol>
                                        <div class="editor">
                                            <a @click="editorClick()" href="javascript:;">
                                                <img src="images/editor.png">
                                            </a>
                                            <span>编辑</span>
                                        </div>
                                        <div class="deletes">
                                            <a @click="deletesClick()" href="javascript:;">
                                                <img src="images/deletes.png">
                                            </a>
                                            <span>删除</span>
                                        </div>
                                    </ol>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!--回访页面弹窗结束-->

                <!--回访弹窗里面的新增回访记录(二级弹窗)-->
                <div class="visitboxDouble hidden">
                    <div class="layerbody">
                        <label>
                            <span>客户状态:</span>
                            <div class="layui-input-block">
                                <select class="industry" id="departPosition" lay-filter="batch"
                                        lay-search="required" lay-verify="required" name="resetTc">
                                    <option class="promptColor" value="">请选择客户状态</option>
                                    <option>有效</option>
                                    <option>无效</option>
                                </select>
                            </div>
                        </label>
                        <label>
                            <span>提醒日期:</span>
                            <div class="layui-input-inline">
                                <input class="layui-input" id="date1" name="resetval" placeholder="yyyy-MM-dd"
                                       type="text"/>
                            </div>
                        </label>
                        <label>
                            <span>跟进日期:</span>
                            <div class="layui-input-inline">
                                <input class="layui-input" id="date2" name="resetval" placeholder="yyyy-MM-dd"
                                       type="text"/>
                            </div>
                        </label>
                        <div class="address">
                            <label>
                                <span>回访记录:</span>
                                <textarea class="contents" name="resetTc" placeholder="回访记录" resize=""
                                          rows="4"></textarea>
                            </label>
                        </div>
                    </div>
                    <button @click="visitsureBtn()" class="surebtn" type="submit">确认</button>
                    <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                </div>
                <!--回访弹窗里面的新增回访记录(二级弹窗)-->


                <!--客户名称弹窗开始-->
                <div class="customerName hidden">
                    <div class="search">
                        <!--模糊查询开始-->
                        <label>
                            <span>客户名称:</span>
                            <div class="searchbox">
                                <input @input="searchWin($event,'archives','title')" placeholder="请输入您要搜索的客户名称"
                                       type="text"/>
                            </div>
                        </label>
                        <!--模糊查询结束-->
                    </div>
                    <div class="layerbody">
                        <ul class="customerNameList">
                            <li class="customerbg">
                                <ol>客户名称</ol>
                                <ol>联系电话</ol>
                                <ol>联系人</ol>
                                <ol>网址</ol>
                            </li>
                            <li @dblclick="doubleClickEvent($event,v.id,v.contacts,v.lasttime,v.userid,v.status)"
                                v-for="(v,k) in ajaxData.archives">
                                <ol class="cumname">{{v.title}}</ol>
                                <ol>{{v.tel}}</ol>
                                <ol>{{v.contacts}}</ol>
                                <ol>{{v.link}}</ol>
                            </li>
                        </ul>
                    </div>
                </div>
                <!--客户名称弹窗结束-->


            </div>
            <div class="t_body">
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                        <tr>
                            <th><input @click="deleteCheckAll()" class="checkboxAll" id="deleteCheckAllIndex"
                                       type="checkbox"> 全选
                            </th>
                            <th>客户名称</th>
                            <th>联系人</th>
<!--                            <th>跟进内容</th>-->
                            <th>跟进时间</th>
                            <th>提醒时间</th>
                            <th>跟进方式</th>
                            <th>跟进阶段</th>
<!--                            <th>状态</th>-->
<!--                            <th>跟进人</th>-->
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr @dblclick="editorClick(v.id)" v-for="(v,k) in tableDataList">
                            <td><input :id="'listcheck' + (v.id)" class="selectCheck" type="checkbox"></td>
                            <td>{{v.title}}</td>
                            <td>{{v.contacts}}</td>
<!--                            <td>{{v.content}}</td>-->
                            <td>{{v.tracktime}}</td>
                            <td></td>
                            <td>{{v.trackfuntitle}}</td>
                            <td>{{v.trackstagetitle}}</td>
<!--                            <td style="color: #f00" v-if="v.status == 0">无效</td>-->
<!--                            <td style="color: #31c37a" v-else>有效</td>-->
<!--                            <td>{{v.realname}}</td>-->
                            <td>
                                <!--                            <div class="returnvisit" v-if="sum(1301)">-->
                                <!--                                <a @click="visitClick()" href="javascript:;">-->
                                <!--                                    <img src="images/visit.jpg">-->
                                <!--                                </a>-->
                                <!--                                <span>回访</span>-->
                                <!--                            </div>-->
                                <div class="editor" v-if="sum(31)">
                                    <a @click="editorClick(v.id)" href="javascript:;">
                                        <img src="images/editor.png">
                                    </a>
                                    <span>编辑</span>
                                </div>
                                <div class="deletes" v-if="sum(32)">
                                    <a @click="deletesClick(v.id)" href="javascript:;">
                                        <img src="images/deletes.png">
                                    </a>
                                    <span>删除</span>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <!---------------------------分页start----------------------------->
                    <div class="pageFen" v-if="totalNum>1">
                        <ul>
                            <li>
                                <a @click="setPage(curNum-1)" class="pageLink" href="#">上一页</a>
                            </li>
                            <li v-for="n in totalNum">
                                <a class="pageLink curNum" v-if="n == curNum" v-text="n"></a>
                                <a @click="setPage(n)" class="pageLink" href="javascript:;" v-else v-text="n"></a>
                            </li>
                            <li><a @click="setPage(curNum+1)" class="pageLink" href="#">下一页</a></li>
                        </ul>
                    </div>
                    <!---------------------------分页end-------------------------------->
                </div>
            </div>
        </section>
    </div>
</div>
<script src="/web/layui/layui.js"></script>
<script src="/web/js/jquery-1.10.0.min.js"></script>
<script src="/web/js/vue.js"></script>
<script src="/web/js/transform.js"></script>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //跟进时间
        laydate.render({
            elem: '#date1', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        laydate.render({
            elem: '#date2', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        laydate.render({
            elem: '#tracktime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
    });
</script>
<script>
    AppData = new Vue({
        el: '#app',
        data: {
            tableData: {},
            categoryIndex: -1,
            cindex: -1,
            userList: {},
            totalNum: 0, //总页数
            listRows: 8, //每页数量
            curNum: 1, //当前页码
            departmentList: {},
            dataList: {},
            map: {},
            tableDataList: [],
            ajaxData: [],
            addoredit: [],
            characterid: 2,
            archivesid: 0,
            archivestitle: '',
            contacts: '',
            contents: '',
            lasttime: '',
            userid: 0,
            trackfunid: 0,
            trackstageid: 0,
            status: 0
        },
        mounted() {
            $("#head").load("header.html");
            $("#right_h").load("right.html");
            this.getIndexData();
        },
        methods: {
            verification(data) {
                if (data.status == 2) {
                    layer.msg(data.message, {icon: 2, time: 1000}, function () {
                        window.location.href = "login.html";
                    });
                }
            },
            search(e) {
                var that = this;
                var keywords = e.target.value;
                this.map.title = keywords;
                this.getIndexData();
            },
            sum(sumid) {//验证列表里的修改删除是否要显示(根据对应的id)
                for (i in this.dataList) {
                    if (sumid == this.dataList[i].id) {
                        return true;
                    }
                }
                return false;
            },
            setPage(num) {
                //页码小于等于1
                if (num < 1) {
                    num = 1;
                }
                //页码大于总页数
                if (num > this.totalNum) {
                    num = this.totalNum;
                }
                //页码赋给当前页
                this.curNum = num;
                this.getIndexData();
            },
            addbtnClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增回访',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['900px', '600px'],
                    content: $('.cusTracking'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/track/create',
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;

                            },
                            error: function (msg) {
                                console.log(msg);
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.cusTracking').hide();
                    }
                })
            },
            editorClick(edid) {
                this.addoredit = edid;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '基本设置',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['900px', '750px'],
                    content: $('.cusTracking'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/track/' + edid,
                            data: {},
                            success: function (data) {
                                console.log(data);
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //输入框赋值
                                var date = new Date(data.info.tracktime * 1000);
                                AppData.archivestitle = data.info.title;
                                AppData.archivesid = data.info.archivesid;
                                AppData.contacts = data.info.contacts;
                                AppData.contents = data.info.content;
                                AppData.lasttime = data.info.tracktime;
                                AppData.userid = data.info.userid;
                                AppData.status = data.info.status;
                                AppData.trackfunid = data.info.trackfunid;
                                AppData.trackstageid = data.info.trackstageid;
                                $('#trackfunid').val(data.info.trackfunid);
                                $('#trackstageid').val(data.info.trackstageid);
                            },
                            error: function (msg) {
                                console.log(msg);
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.cusTracking').hide();
                    }
                })
            },
            addsureBtn() {
                var data = {
                    title: this.archivestitle,
                    archivesid: this.archivesid,
                    contacts: $('#contacts').val(),
                    content: $('#contents').val(),
                    tracktime: $('#tracktime').val(),
                    trackfunid: $('#trackfunid').val(),
                    userid: $('#userid').val(),
                    trackstageid: $('#trackstageid').val(),
                    status: $('#status').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/track',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getIndexData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                            console.log(msg);
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/track/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getIndexData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                            console.log(msg);
                        }
                    });
                }
            },
            deleteCheckAll() {
                let checkBoxs = AppData.tableDataList;
                if ($('#deleteCheckAllIndex').is(":checked")) {
                    for (let j in checkBoxs) {
                        $('#listcheck' + checkBoxs[j].id).prop('checked', true);
                    }
                } else {
                    for (let j in checkBoxs) {
                        $('#listcheck' + checkBoxs[j].id).prop('checked', false);
                    }
                }
            },
            deletesClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function (){
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.tableDataList;
                            for (let i in checkBoxs) {
                                if ($('#listcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/track/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        AppData.getIndexData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                                console.log(msg);
                            }
                        });
                    });
                });
            },
            adSearchbtnClick() {
                $('.searchBox').slideToggle();
                $('.search').toggle();
            },
            resetbtnClick() {
                $('input[name="resetval"]').val('');
                $('select[name="resetval"]').val('');
            },
            addresetBtn() {
                $('input[name="resetTc"]').val('');
                $('select[name="resetTc"]').val('0');
                $('textarea[name="resetTc"]').val('');
                this.archivestitle = '';
                this.contacts = '';
                this.lasttime = '';
                this.trackfunid = 0;
                this.userid = 0;
                this.trackstageid = 0;
                this.status = 0;
            },
            visitClick() {//回访弹窗
                var layer01 = layer.open({
                    type: 1,
                    title: '回访',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['800px', '650px'],
                    content: $('.visitBox'),
                    success: function () {

                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.visitBox').hide();
                    }
                });
            },
            addvisitClick() {//回访弹窗里面的二级弹窗
                var layer02 = parent.layer.open({
                    type: 1,
                    title: '回访',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['800px', '600px'],
                    content: $('.visitboxDouble'),
                    success: function () {

                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.visitboxDouble').hide();
                    }
                });
            },
            customerListchange() {//点击客户名称列表
                mylay = layer.open({
                    type: 1,
                    title: '选择客户',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['800px', '650px'],
                    id: 'layer03',
                    content: $('.customerName'),
                    success: function () {
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.customerName').hide();
                    }
                })
            },
            changecontacts(e) {
                this.contacts = e.target.value
            },
            doubleClickEvent(e, archivesid, contacts, lasttime, userid, status) {
                var lis = e.currentTarget.firstElementChild.innerHTML;
                // var date = new Date(lasttime * 1000);
                this.archivestitle = lis;
                this.archivesid = archivesid;
                this.contacts = contacts;
                this.lasttime = lasttime;
                this.userid = userid;
                this.status = status;
                layer.close(mylay)
            },
            searchWin(e, table, field) {//客户列表搜索名称
                var that = this;
                var keywords = e.target.value;
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/keyword',
                    data: {'table': table, 'field': field, 'keywords': keywords},
                    success: function (data) {
                        AppData.ajaxData.archives = data.list;
                    },
                    error: function (msg) {
                        console.log(msg);
                    }
                });
            },
            //首页数据渲染
            getIndexData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/track',
                    data: {'listRows': this.listRows, 'page': this.curNum, map:this.map},
                    success: function (data) {
                        console.log(data);
                        AppData.verification(data);
                        AppData.dataList = data.userInfo.jurisdiction;
                        AppData.totalNum = data.list.last_page;
                        AppData.ajaxData = data;
                        let dataS = data.userInfo.jurisdiction;//后台初始数据
                        var dataArr = [];
                        for (let i in dataS) {
                            dataArr.push(dataS[i]); //属性
                        }
                        /*调用封装的改变数据结构方法*/
                        let tableData = setTreeData(dataArr);
                        let tableDataObj = {...tableData};//把转换后的数组通过扩展运算符改成对象便于遍历
                        AppData.tableData = tableDataObj;
                        //表格中数据的渲染
                        let tableList = {...data.list.data};
                        AppData.tableDataList = tableList;
                        },
                        error: function (msg) {
                        console.log(msg);
                    }
                });
            }
        }
    })
</script>
</body>
</html>
